<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('余额明细列表')" />
</head>
<body class="gray-bg">
    
     <div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="formId">
					<div class="select-list">
						<ul>
							<li>
								用户id：<input type="text" name="memberId"/>
							</li>

							<li>
								使用订单号：<input type="text" name="orderId"/>
							</li>

							<li>
								支付单号：<input type="text" name="paymentId"/>
							</li>

							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
								<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
			
	        <div class="btn-group-sm" id="toolbar" role="group">
				<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="member:memberAdvance:export">
					<i class="fa fa-download"></i> 导出
				 </a>
			</div>
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('member:memberAdvance:edit')}]];
        var removeFlag = [[${@permission.hasPermi('member:memberAdvance:remove')}]];
        var prefix = ctx + "member/memberAdvance";

        $(function() {
            var options = {
                url: prefix + "/list",
				exportUrl: prefix + "/export",
                modalName: "余额明细",
		        showExport: true,
                columns: [{
		            checkbox: true
		        },
				{
					field : 'id', 
					title : '日志id',
					visible: false
				},
				{
					field : 'memberId', 
					title : '用户id',
					sortable: true
				},
				{
					field : 'money', 
					title : '金额',
					sortable: true
				},
				{
					field : 'orderId', 
					title : '使用订单号',
					sortable: true
				},
				{
					field : 'paymentId', 
					title : '支付单号',
					sortable: true
				},
				{
					field : 'type', 
					title : '业务类型',
					sortable: true,
					formatter: function(val, row, index) {
						if(val == 1) {
							return '管理员操作';
						} else if(val == 2) {
							return '下单使用';
						} else if(val == 3) {
							return '充值';
						} else {
							return val;
						}
					}
				},
				{
					field : 'memberAdvance', 
					title : '当前余额',
					sortable: true
				},
				{
					field : 'remark', 
					title : '备注',
					sortable: true
				},
				{
					field : 'operatorId', 
					title : '操作员ID',
					sortable: true,
					visible: false
				},
				{
					field : 'operator', 
					title : '操作员',
					sortable: true
				},
				{
					field : 'createTime', 
					title : '创建时间',
					sortable: true
				}]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>